package com.example.musicdemo.internal.loader

import android.content.Context
import android.database.Cursor
import android.net.Uri
import android.provider.MediaStore
import androidx.loader.content.CursorLoader

class MusicLoader private constructor(
    context: Context?

) :  CursorLoader(context!!, URI, PROJECTION, null, null,null ) {
        companion object{
            val URI:Uri =MediaStore.Audio.Media.EXTERNAL_CONTENT_URI

            val PROJECTION = arrayOf(MediaStore.Audio.Media._ID,
                MediaStore.Audio.Media.DATA,
                MediaStore.Audio.Media.SIZE,
                MediaStore.Audio.Media.DISPLAY_NAME,
                MediaStore.Audio.Media.ARTIST)

            fun newInstance(context: Context?): MusicLoader {
                return MusicLoader(context)
            }
        }


}